container_aria

my file learn about tech container (docker, podman, kubernetes)


Project maintained by ariafatah0711 Hosted on GitHub Pages — Theme by mattgraham

health check

syntax

    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
      interval: 1m30s
      timeout: 30s
      retries: 3
      start_period: 5s

health check
# test => berisikan cara melakukan test health check
# interval
# timeout
# retries => total retry
# start_period => waktu mulai

contoh

version: '3.8'

services:
  app:
    container_name: app
    build:
      context: ./app
      dockerfile: dockerfile
    image: "app-golang:2.0.0"
    environment:
      - "APP_PORT=8080"
    ports:
      - "8080:8080"
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
      interval: 1m30s
      timeout: 30s
      retries: 3
      start_period: 5s